<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGoodsCartsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_carts', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('sku_id')->comment("具体商品id");
            $table->unsignedInteger('users_id')->comment("用户id");
            $table->string('title')->comment("标题");
            $table->string('image')->comment("商品图片");
            $table->unsignedInteger("num")->default(0)->comment("商品数量");
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods_carts');
    }
}
